Skip to content

docs: same header on every page, no light flash in dark mode - #343

Merged
ChristopherPHolder merged 1 commit into
mainfrom
t3/docks-navigation-theme-fix
Nov 7, 2026
Merged

ChristopherPHolder merged 1 commit into
mainfrom
t3/docks-navigation-theme-fix

Conversation

@ChristopherPHolder

Copy link
Copy Markdown
Collaborator

Summary

  • The menu button and the docs drawer were only rendered on doc pages, so the landing page had a different header on phones. The drawer is now part of every page: a sidebar beside doc pages, an off-canvas drawer behind the menu button below 900px everywhere else, and hidden on wide non-doc pages.
  • Devices in dark mode painted the page light first and switched to dark a moment later. The prerendered pages inlined only the light theme tokens as critical CSS and loaded the stylesheet with the dark block lazily. Critical CSS inlining is now off for the production build, so the small stylesheet blocks the first paint and the page starts in the right theme, also for a stored dark choice.

Testing

  • Built the production bundle and checked the prerendered HTML: the stylesheet is a plain blocking link and the landing page renders the menu button and drawer.
  • Headless Chrome at 390px wide, light and dark: landing and doc headers match, the drawer opens from the landing page and navigates into the docs, and the body background is dark at DOMContentLoaded with a dark system scheme.
  • Desktop landing page: no sidebar and no menu button.
  • nx lint docs passes.

The menu button and the docs drawer only existed on doc pages, so the
landing page header lost its hamburger on phones. The drawer is now part
of every page: beside the content on doc pages, off-canvas behind the
menu button below 900px everywhere, hidden on wide non-doc pages.

The prerendered pages inlined only the light theme tokens as critical
CSS and loaded the stylesheet with the dark block lazily, so a device in
dark mode painted light first and switched a moment later. Critical CSS
inlining is off for the production build; the stylesheet is small and
blocks the first paint, so the page starts in the right theme.
@ChristopherPHolder
ChristopherPHolder merged commit adacee4 into main Nov 7, 2026
5 checks passed
@ChristopherPHolder
ChristopherPHolder deleted the t3/docks-navigation-theme-fix branch November 7, 2026 15:34
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

❗❗❗ report generated by this PR ❗❗❗

☕ Order Coffee ☕

Date/Time: 2026-11-07 15:35

Step Name Gather Mode Performance Accessibility Best Practices Seo Agentic Browsing
🧭 Navigate to coffee cart navigation 91 93 100 83 50
☕ Select coffee timespan 17/17 - 8/8 - -
✔ Coffee selected snapshot Ø 1/1 16/18 4/4 3/5 1/3
🛒 Checkout order timespan 19/19 - 8/8 - -
🧾 Order checked out snapshot Ø 1/1 19/20 4/4 3/5 1/3
💌 Submit order timespan 18/18 - 8/8 - -
📧 Order submitted snapshot Ø 1/1 20/22 4/4 3/5 1/3
🧭 Navigate to github navigation 91 92 100 83 50

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

☕ Order Coffee ☕

Date/Time: 2026-11-07 15:35

Step Name Gather Mode Performance Accessibility Best Practices Seo Agentic Browsing
🧭 Navigate to coffee cart navigation 95 93 100 83 50
☕ Select coffee timespan 17/17 - 8/8 - -
✔ Coffee selected snapshot Ø 1/1 16/18 4/4 3/5 1/3
🛒 Checkout order timespan 19/19 - 8/8 - -
🧾 Order checked out snapshot Ø 1/1 19/20 4/4 3/5 1/3
💌 Submit order timespan 18/18 - 8/8 - -
📧 Order submitted snapshot Ø 1/1 20/22 4/4 3/5 1/3
🧭 Navigate to github navigation 93 92 100 83 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant